home *** CD-ROM | disk | FTP | other *** search
- |
- | Sample AutoPilot script: Waiting for multiple phrases from the modem
- |____________________________________________________________________________
- clear
- trace off
- |____________________________________________________________________________
- st="" | make a string variable
- array st 5 | dimension it to hold 5 strings
- |
- st[1]="this" | fill them with the phrases to wait for
- st[2]="that" |
- st[3]="anything" |
- st[4]="mail waiting" |
- st[5]="goodbye" |
- |
- goodbye=5 | just for the heck of it
- |
- _begin | place to loop back to
- |
- choice = Wait 30 st | wait for 1 of the phrases for 30 seconds
- |
- Print "choice=" | put the results to the screen, 0 if timed-out
- Print choice | choice matches the string array index if found
- Print "~" | a carriage return
- |
- IF choice | print the phrase to the screen if found
- Print st[choice] | note: see how arrays can be used anywhere
- Print "~" |
- ENDIF |
- |
- IF the choice is goodbye| checking for choice 5 (add other ELSEIF's as needed)
- QUIT |
- ENDIF |
- |
- GOTO begin | keep on going
- | remember, the <UNDO> key may be used to end autopilot
-